<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('编辑电话记录')" />
    <th:block th:include="include :: select2-css" />
</head>
<body>
<div class="main-content">
    <form id="form-user-add" class="form-horizontal">
        <input name="deptId" type="hidden" id="deptId"/>
        <input id="liftInt" name="liftInt" type="hidden" value="0"/>
        <input id="liftStr" name="liftStr" type="hidden" value=""/>
        <input id="fmSpareA" name="fmSpareA" type="hidden" value=""/>
        <input id="fmSpareB" name="fmSpareB" type="hidden" value=""/>

        <input id="callId" name="callId"  type="hidden" th:value="${param.callid}"/>
        <input id="tapeId" name="tapeId"  type="hidden" th:value="${param.tapeid}"/>
        <input id="fromTelC" name="fromTelC"  type="hidden" th:value="${param.calledid}"/>
        <input id="flagInt" name="flagInt" type="hidden" value="0"/>
        <input id="flagString" name="flagString" type="hidden" value=""/>
        <input id="spareInt" name="spareInt" type="hidden" value="0"/>
        <input id="manyidu" name="spareString" type="hidden" value=""/>
        <input id="txtAutoOpen" name="autoGetFlag" type="hidden" value="-1"/>
        <input id="liftWorkNo" name="liftWorkNo" type="hidden" th:value="${telGetDeal.liftWorkNo}"/>
        <input id="liftWorker" name="liftWorker" type="hidden" th:value="${telGetDeal.liftWorker}"/>
        <input id="liftTelNo" name="liftTelNo" type="hidden" th:value="${telGetDeal.liftTelNo}"/>
        <input id="fromTime" name="fromTime" type="hidden" />
        <input id="liftEnd" name="liftEnd" type="hidden"/>

        <div style="display: flex;flex-direction: row;align-items: center;font-size: 20px;">
            <div style="height: 20px;width: 5px;background-color: #206ef7;margin-right: 5px;"></div>
            <h4 class="h4" style="font-size: 15px">来电人信息</h4>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">来电号码：</label>
                    <div class="col-sm-8">
                        <div class="form-control"  style="border: none"><input type="text" name="fromTelA" th:value="${param.callin}"> </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">通话时间：</label>
                    <div class="col-sm-8">
                        <div class="form-control-static" style="border: none">6.3分钟</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">历史来电数：</label>
                    <div class="col-sm-8">
                        <div class="form-control-static" style="border: none">105</div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">历史不满意数：</label>
                    <div class="col-sm-8">
                        <div class="form-control-static" style="border: none">100</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">地区：</label>
                    <div class="col-sm-8">
                        <select name="fmAreaNo" id="fmAreaNo" onchange="dropChgSendTextOnly(this,'fmAreaName');"
                                th:with="district=${@commonServiceImpl.findArea()}"
                                class="form-control formSelect" required>
                            <option value="">--请选择--</option>
                            <option th:each="item : ${district}" th:text="${item['CSText']}"
                                    th:value="${item['CSValue']}"></option>
                            </select>
                                <input type="hidden" id="fmAreaName" name="fmAreaName"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">常涉及问题：</label>
                    <div class="col-sm-8">
                        <div class="form-control-static" style="border: none">农村农业  城乡建设  噪音扰民</div>
                    </div>
                </div>
            </div>
        </div>
        <div style="display: flex;flex-direction: row;align-items: center;font-size: 20px;">
            <div style="height: 20px;width: 5px;background-color: #206ef7;margin-right: 5px;"></div>
            <h4 class="h4" style="font-size: 15px">受理模块</h4>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">详细地址：</label>
                    <div class="col-sm-8">
                        <input name="fmAddress" placeholder="请输入详细地址" class="form-control" type="text"  required>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">来电内容：</label>
                    <div class="col-xs-10">
                        <textarea name="fmContent" maxlength="1000" class="form-control phoneRemark" rows="3"></textarea>

                        <span>还可以输入<i class="phoneRemarkI">1000</i>个文字</span>
                        <button type="button" class="btn btn-sm btn-primary" style="position: absolute;right: 15px">智能预载</button>
                    </div>
                </div>
            </div>
        </div>

        <div style="display: flex;flex-direction: row;align-items: center;font-size: 20px;">
            <div style="height: 20px;width: 5px;background-color: #206ef7;margin-right: 5px;"></div>
            <h4 class="h4" style="font-size: 15px">基本信息</h4>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label ">流水号：</label>
                    <div class="col-sm-8">
                        <input name="wsCode" placeholder="请输入流水号" class="form-control" type="text" maxlength="30" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">提取码：</label>
                    <div class="col-sm-8">
                        <input name="wsKey"  type="text" placeholder="请输入提取码" class="form-control">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">来电类别：</label>
                    <div class="col-sm-8">
                        <select name="dfmClaNo" id="dFmClaNo"
                                th:with="telTypes=${@commonServiceImpl.findTelType()}"
                                onchange="dropChgSendTextOnly(this,'dFmClaName');"
                                class="form-control formSelect" required>
                            <option value="">--请选择--</option>
                            <th:block th:each="item : ${telTypes}">
                                <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
                            </th:block>
                        </select>
                        <input type="hidden" name="dfmClaName" id="dFmClaName"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">内容类别：</label>
                    <div class="col-sm-8">
                        <input id="treeName" name="dcntAname" onclick="selectDeptTree()" class="form-control"
                               type="text" maxlength="50" required="" aria-required="true">
                        <input id="treeId" name="dcntAcode" type="hidden"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证件：</label>
                    <div class="col-sm-8">
                        <select id="fmCerNO" name="fmCerNO" onchange="dropChgSendTextOnly(this,'fmCerName');"
                                th:with="cerTypes=${@commonServiceImpl.findCerType()}" class="form-control formSelect">
                            <option value="">--请选择--</option>
                            <option th:each="item : ${cerTypes}" th:text="${item['CSText']}"
                                    th:value="${item['CSValue']}"></option>
                        </select>
                        <input class="form-control" type="hidden" value="" name="fmCerName">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">来电人名：</label>
                    <div class="col-sm-8">
                        <input name="fromName" placeholder="请输入来电人名" class="form-control" type="text"  required>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">性别：</label>
                    <div class="col-sm-8">
                        <select name="fromSex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">联系电话：</label>
                    <div class="col-sm-8">
                        <input name="fromTelB" placeholder="请输入联系电话" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="spRed">*</span>坐席处理：</label>
                    <div class="col-sm-10">
                        <select id="xDealDescSelect" class="form-control formSelect" style="margin-bottom: 5px;"
                                onchange="dropChgSendTextOnly(this,'xdealDesc');">
                            <option value="-1">---处理来电常用语---</option>
                            <option value="-110">请 XXX 调查处理后直接与来话人联系，并将处理结果抄复我办。</option>
                            <option value="-120">已当场处理</option>
                            <option value="-130">来话人反映外地（xx市）问题，建议其向当地职能部门反映</option>
                            <option value="-140">请来话人了解清楚后再做反映</option>
                            <option value="-150">已建议来话人以适当形式向市纪委监察局（12388）反映</option>
                            <option value="-160">查询知识库或相关资料，告知来话人：</option>
                            <option value="-170">建议来话人：</option>
                            <option value="-180">经查，反映问题与（工单编号：）相同，告知来话人已有市民反映，且职能部门正在办理</option>
                            <option value="-190">
                                经查，工单编号为（）的来电，相关部门正在积极的处理中，请耐心等待处理结果。12345热线公开电话的处理时限为：一般问题5个工作日内回复，较复杂问题15个工作日内给予回复，特别重大及疑难问题按照信访条列60天内回复。欢迎多提宝贵意见！
                            </option>
                            <option value="-200">记录并整理通话内容，告知来话人后续由相关职能部门进行办理</option>
                            <option value="-210">感谢您对成都市政府工作的关心和支持。欢迎多提宝贵意见！</option>
                            <option value="-220">已当即联系自来水公司（962965）、电业局（95598）、天然气公司（962777）的***号工作人员处理。</option>
                            <option value="-230">您所反映的问题我办已多次受理，并且相关部门已进行多次回复和解释，对此我办不再受理该问题，请您通过其他途径解决</option>
                            <option value="-240">据查，您反映情况不属实，并且相关部门已进行了回复和解释，对此我办不再受理该问题。</option>
                        </select>
                        <textarea name="xdealDesc" id="xdealDesc" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-2 control-label">坐席备注：</label>
                    <div class="col-sm-10">
                        <select id="xSysDescSelect" class="form-control formSelect" style="margin-bottom: 5px;"
                                onchange="dropChgSendTextOnly(this,'xsysDesc');">
                            <option value="-1">---内部交流常用语---</option>
                            <option value="110">无效来电，请核查办结</option>
                            <option value="120">当场办结，请核查办结</option>
                            <option value="130">建议回电联系来话人后酌情处理</option>
                            <option value="140">反映问题与（）相同，酌情催办工单</option>
                            <option value="150">建议创建工单，请职能部门（）办理。</option>
                            <option value="150">来话人特别要求：</option>
                        </select>
                        <textarea name="xsysDesc" id="xsysDesc" rows="3" class="form-control"></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">电子邮件：</label>
                    <div class="col-sm-8">
                        <input name="fmEmail" placeholder="请输入电子邮件" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
        </div>

        <div style="display: flex;flex-direction: row;align-items: center;font-size: 20px;">
            <div style="height: 20px;width: 5px;background-color: #206ef7;margin-right: 5px;"></div>
            <h4 class="h4" style="font-size: 15px">坐席情况</h4>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">屏蔽号码：</label>
                    <div class="col-xs-10">
                        <label class="check-box">
                            <input name="role" value="1" checked type="radio">是
                        </label>
                        <label class="check-box">
                            <input name="role" value="0" type="radio">否
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">同意公开：</label>
                    <div class="col-xs-10">
                        <label class="check-box">
                            <input name="openFrom" value="1" checked type="radio">是
                        </label>
                        <label class="check-box">
                            <input name="openFrom" value="0" type="radio">否
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">重复来电：</label>
                    <div class="col-xs-10">
                        <label class="check-box">
                            <input name="repeatFlag" value="1" checked type="radio">是
                        </label>
                        <label class="check-box">
                            <input name="repeatFlag" value="0" type="radio">否
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">处理选项：</label>
                    <div class="col-xs-10">
                        <label class="check-box">
                            <input name="stateFlag" value="101" checked type="radio">存草稿
                        </label>
                        <label class="check-box">
                            <input name="stateFlag" value="120" type="radio">转值班长处理
                        </label>
                        <label class="check-box">
                            <input name="stateFlag" value="131" type="radio">当场解答
                        </label>
                        <label class="check-box">
                            <input name="stateFlag" value="132" type="radio">无效来电
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label">坐席备注：</label>
                    <div class="col-xs-10">
                        <textarea name="SeatsRemark" maxlength="3500" class="form-control SeatsRemark" rows="3"></textarea>
                        <span>还可以输入<i class="SeatsRemarkI">3500</i>个文字</span>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<!--<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
    </div>
</div>-->
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script>
    var prefix = ctx + "system/telGetDeal";
    $(function(){
        $("#fromTime").val(DateToStr())
        var textArea = $('.SeatsRemark');
        var numItem = $('.SeatsRemarkI');
        var max = numItem.text(); //i标签中的内容，也就是最多可以显示的字符数
        var curLength = textArea.val().length; //当前的字符数

        textArea.attr('maxlength',max); //设置最大字符数，如果去掉的话，i标签内会出现负数
        numItem.text(max - curLength); //实时更新i标签中的数量
        textArea.on('input propertychange', function () {
            //$(this) ---> 指代textarea
            numItem.text(max - $(this).val().length);
        });

        var textArea2 = $('.phoneRemark');
        var numItem2 = $('.phoneRemarkI');
        var max2 = numItem2.text();
        var curLength2 = textArea2.val().length;

        textArea2.attr('maxlength',max2);
        numItem2.text(max2 - curLength2);
        textArea2.on('input propertychange', function () {
            numItem2.text(max2 - $(this).val().length);
        });
    })

    /*部门管理-新增-选择父部门树*/
    function selectDeptTree() {
        var options = {
            title: '内容类别选择',
            width: "380",
            url: ctx + "system/common/findContentCategories/11",
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }


    function DropChgSendTextOnly(e,acpId) {
        document.getElementById(acpId).value = e.options[e.selectedIndex].text;
    }
    function doSubmit(index, layero) {
        var body = layer.getChildFrame('body', index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        layer.close(index);
    }

    function submitHandler() {
        $("#liftEnd").val(DateToStr())
        if ($.validate.form()) {
            var data = $('#form-user-add').serializeArray();

            $.ajax({
                cache: true,
                type: "POST",
                url: ctx + "system/mTelRcd/add",
                data: data,
                async: false,
                error: function (request) {
                    $.modal.alertError("系统错误");
                },
                success: function (data) {
                    $.operate.successCallback(data);
                }
            });
        }
    }

</script>
</body>
</html>
